package openai

import (
	"gitee.com/jn-qq/big-model/common"
	"log"
)

func NewOpenAiClient(model common.Model) *OpenAI {
	if model.Url == "" || model.ModelType == "" {
		log.Fatal("url or modelType is empty")
		return nil
	}

	return &OpenAI{
		modelInfo:      model,
		temperature:    common.DefaultTemperature,
		maxTokens:      common.DefaultTokens,
		streamEnable:   model.IsReason,
		historyMessage: common.NewHistoryManager(),
	}
}

var (
	// DeepSeekR1 深度思考模型
	DeepSeekR1 = common.Model{
		Url:       "https://api.deepseek.com/chat/completions",
		ModelType: "deepseek-reasoner",
		IsReason:  true,
	}
	// DeepSeekV3 对话模型
	DeepSeekV3 = common.Model{
		Url:       "https://api.deepseek.com/chat/completions",
		ModelType: "deepseek-chat",
		IsReason:  false,
	}
	// IflytekX 讯飞星火对话模型
	IflytekX = common.Model{
		Url:       "http://maas-api.cn-huabei-1.xf-yun.com/v1/chat/completions",
		ModelType: "xsparkprox",
		IsReason:  false,
	}
)
